function InvitRecord(params){ 
	 
}

InvitRecord.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new InvitRecord.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new InvitRecord.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new InvitRecord.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
		
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
		
		
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
		 
	
	
	/** 品牌  [Merchant]      **/
	this.brand=function(brand){if(this.proxy)return this.getProxy().brand(brand);  this.put("brand", brand);return this;};
	/** and brand is null */
	this.brandNull=function(){if(this.proxy)return this.getProxy().brandNull();if(this.get("brandNot")==null)this.put("brandNot", "");this.put("brand", null);return this;};
	/** not .... */
	this.brandNot=function(){if(this.proxy)return this.getProxy().brandNot();this.put("brandNot", "not");return this;};
	this.brandNotNull=function(){if(this.proxy)return this.getProxy().brandNotNull();this.put("brandNot", "not");this.put("brand", null);return this;};
	this.brandNot=function(brand){if(this.proxy)return this.getProxy().brandNot(brand);this.put("brandNot", "not");this.put("brand", brand);return this;};
		
		
	this.brandIn=function(ids){
		if(this.proxy)return this.getProxy().brandIn(ids);  this.put("brandIn", ids);return this;
	};	
		 
	
	
	/** 被邀人 [非空] [Member]      **/
	this.invitedPerson=function(invitedPerson){if(this.proxy)return this.getProxy().invitedPerson(invitedPerson);  this.put("invitedPerson", invitedPerson);return this;};
	/** and invited_person is null */
	this.invitedPersonNull=function(){if(this.proxy)return this.getProxy().invitedPersonNull();if(this.get("invitedPersonNot")==null)this.put("invitedPersonNot", "");this.put("invitedPerson", null);return this;};
	/** not .... */
	this.invitedPersonNot=function(){if(this.proxy)return this.getProxy().invitedPersonNot();this.put("invitedPersonNot", "not");return this;};
	this.invitedPersonNotNull=function(){if(this.proxy)return this.getProxy().invitedPersonNotNull();this.put("invitedPersonNot", "not");this.put("invitedPerson", null);return this;};
	this.invitedPersonNot=function(invitedPerson){if(this.proxy)return this.getProxy().invitedPersonNot(invitedPerson);this.put("invitedPersonNot", "not");this.put("invitedPerson", invitedPerson);return this;};
		
		
	this.invitedPersonIn=function(ids){
		if(this.proxy)return this.getProxy().invitedPersonIn(ids);  this.put("invitedPersonIn", ids);return this;
	};	
		 
	
	
	/** 折扣券ID  [Coupon]      **/
	this.invitedCoupon=function(invitedCoupon){if(this.proxy)return this.getProxy().invitedCoupon(invitedCoupon);  this.put("invitedCoupon", invitedCoupon);return this;};
	/** and invited_coupon is null */
	this.invitedCouponNull=function(){if(this.proxy)return this.getProxy().invitedCouponNull();if(this.get("invitedCouponNot")==null)this.put("invitedCouponNot", "");this.put("invitedCoupon", null);return this;};
	/** not .... */
	this.invitedCouponNot=function(){if(this.proxy)return this.getProxy().invitedCouponNot();this.put("invitedCouponNot", "not");return this;};
	this.invitedCouponNotNull=function(){if(this.proxy)return this.getProxy().invitedCouponNotNull();this.put("invitedCouponNot", "not");this.put("invitedCoupon", null);return this;};
	this.invitedCouponNot=function(invitedCoupon){if(this.proxy)return this.getProxy().invitedCouponNot(invitedCoupon);this.put("invitedCouponNot", "not");this.put("invitedCoupon", invitedCoupon);return this;};
		
		
	this.invitedCouponIn=function(ids){
		if(this.proxy)return this.getProxy().invitedCouponIn(ids);  this.put("invitedCouponIn", ids);return this;
	};	
		 
	
	
	/** 受邀折扣        **/
	this.invitedDiscount=function(invitedDiscount){if(this.proxy)return this.getProxy().invitedDiscount(invitedDiscount);  this.put("invitedDiscount", invitedDiscount);return this;};
	/** and invited_discount is null */
	this.invitedDiscountNull=function(){if(this.proxy)return this.getProxy().invitedDiscountNull();if(this.get("invitedDiscountNot")==null)this.put("invitedDiscountNot", "");this.put("invitedDiscount", null);return this;};
	/** not .... */
	this.invitedDiscountNot=function(){if(this.proxy)return this.getProxy().invitedDiscountNot();this.put("invitedDiscountNot", "not");return this;};
	this.invitedDiscountNotNull=function(){if(this.proxy)return this.getProxy().invitedDiscountNotNull();this.put("invitedDiscountNot", "not");this.put("invitedDiscount", null);return this;};
	this.invitedDiscountNot=function(invitedDiscount){if(this.proxy)return this.getProxy().invitedDiscountNot(invitedDiscount);this.put("invitedDiscountNot", "not");this.put("invitedDiscount", invitedDiscount);return this;};
		
	/** and invited_discount <= ? */
	this.invitedDiscountMin=function(min){if(this.proxy)return this.getProxy().invitedDiscountMin(min);this.put("invitedDiscountMin", min);return this;};
	/** and invited_discount >= ? */
	this.invitedDiscountMax=function(max){if(this.proxy)return this.getProxy().invitedDiscountMax(max);this.put("invitedDiscountMax", max);return this;};
		
		 
	
	
	/** 推荐人 [非空] [Member]      **/
	this.recom=function(recom){if(this.proxy)return this.getProxy().recom(recom);  this.put("recom", recom);return this;};
	/** and recom is null */
	this.recomNull=function(){if(this.proxy)return this.getProxy().recomNull();if(this.get("recomNot")==null)this.put("recomNot", "");this.put("recom", null);return this;};
	/** not .... */
	this.recomNot=function(){if(this.proxy)return this.getProxy().recomNot();this.put("recomNot", "not");return this;};
	this.recomNotNull=function(){if(this.proxy)return this.getProxy().recomNotNull();this.put("recomNot", "not");this.put("recom", null);return this;};
	this.recomNot=function(recom){if(this.proxy)return this.getProxy().recomNot(recom);this.put("recomNot", "not");this.put("recom", recom);return this;};
		
		
	this.recomIn=function(ids){
		if(this.proxy)return this.getProxy().recomIn(ids);  this.put("recomIn", ids);return this;
	};	
		 
	
	
	/** 折扣券ID  [Coupon]      **/
	this.recomCoupon=function(recomCoupon){if(this.proxy)return this.getProxy().recomCoupon(recomCoupon);  this.put("recomCoupon", recomCoupon);return this;};
	/** and recom_coupon is null */
	this.recomCouponNull=function(){if(this.proxy)return this.getProxy().recomCouponNull();if(this.get("recomCouponNot")==null)this.put("recomCouponNot", "");this.put("recomCoupon", null);return this;};
	/** not .... */
	this.recomCouponNot=function(){if(this.proxy)return this.getProxy().recomCouponNot();this.put("recomCouponNot", "not");return this;};
	this.recomCouponNotNull=function(){if(this.proxy)return this.getProxy().recomCouponNotNull();this.put("recomCouponNot", "not");this.put("recomCoupon", null);return this;};
	this.recomCouponNot=function(recomCoupon){if(this.proxy)return this.getProxy().recomCouponNot(recomCoupon);this.put("recomCouponNot", "not");this.put("recomCoupon", recomCoupon);return this;};
		
		
	this.recomCouponIn=function(ids){
		if(this.proxy)return this.getProxy().recomCouponIn(ids);  this.put("recomCouponIn", ids);return this;
	};	
		 
	
	
	/** 折扣        **/
	this.recomDiscount=function(recomDiscount){if(this.proxy)return this.getProxy().recomDiscount(recomDiscount);  this.put("recomDiscount", recomDiscount);return this;};
	/** and recom_discount is null */
	this.recomDiscountNull=function(){if(this.proxy)return this.getProxy().recomDiscountNull();if(this.get("recomDiscountNot")==null)this.put("recomDiscountNot", "");this.put("recomDiscount", null);return this;};
	/** not .... */
	this.recomDiscountNot=function(){if(this.proxy)return this.getProxy().recomDiscountNot();this.put("recomDiscountNot", "not");return this;};
	this.recomDiscountNotNull=function(){if(this.proxy)return this.getProxy().recomDiscountNotNull();this.put("recomDiscountNot", "not");this.put("recomDiscount", null);return this;};
	this.recomDiscountNot=function(recomDiscount){if(this.proxy)return this.getProxy().recomDiscountNot(recomDiscount);this.put("recomDiscountNot", "not");this.put("recomDiscount", recomDiscount);return this;};
		
	/** and recom_discount <= ? */
	this.recomDiscountMin=function(min){if(this.proxy)return this.getProxy().recomDiscountMin(min);this.put("recomDiscountMin", min);return this;};
	/** and recom_discount >= ? */
	this.recomDiscountMax=function(max){if(this.proxy)return this.getProxy().recomDiscountMax(max);this.put("recomDiscountMax", max);return this;};
		
		 
	
	
	/** 邀请类型    1:新人邀请 2:老用户回归     **/
	this.invitrType=function(invitrType){if(this.proxy)return this.getProxy().invitrType(invitrType);  this.put("invitrType", invitrType);return this;};
	/** and invitr_type is null */
	this.invitrTypeNull=function(){if(this.proxy)return this.getProxy().invitrTypeNull();if(this.get("invitrTypeNot")==null)this.put("invitrTypeNot", "");this.put("invitrType", null);return this;};
	/** not .... */
	this.invitrTypeNot=function(){if(this.proxy)return this.getProxy().invitrTypeNot();this.put("invitrTypeNot", "not");return this;};
	this.invitrTypeNotNull=function(){if(this.proxy)return this.getProxy().invitrTypeNotNull();this.put("invitrTypeNot", "not");this.put("invitrType", null);return this;};
	this.invitrTypeNot=function(invitrType){if(this.proxy)return this.getProxy().invitrTypeNot(invitrType);this.put("invitrTypeNot", "not");this.put("invitrType", invitrType);return this;};
		
		
	this.invitrTypeIn=function(ids){
		if(this.proxy)return this.getProxy().invitrTypeIn(ids);  this.put("invitrTypeIn", ids);return this;
	};	
		 
	
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
		
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
		
		 
	
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
		
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
		
		 
	
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
		
		
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有邀请记录 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/users/invitrecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取邀请记录分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/users/invitrecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取邀请记录 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/users/invitrecord.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

InvitRecord.get = function(id){
	var protocol = ux.ajax("/admin/users/invitrecord.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.invitRecord;
	return null;
}

InvitRecord.where = new InvitRecord.Where(0,true);